package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Param;
import org.csu.mypetstore.domain.Product;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductMapper {
    List<Product> getProductListByCategory(String categoryId);

    Product getProduct(String productId);

    List<Product> searchProductList(String keywords);

    void insertProduct(Product product);

    void deleteProduct(@Param("productId") String productId);

    void insertProduct(@Param("productId") String productId,@Param("categoryId") String categoryId,@Param("name") String name,@Param("descn") String descn,@Param("picture") String picture);

    void editProduct(@Param("productId")String productId,@Param("categoryId") String categoryId,@Param("name")String name,@Param("descn") String descn,@Param("picture") String picture);

    void deleteProductByCategoryId(@Param("categoryId") String categoryId);
}